package com.oscar.practice.shiro.dao.user;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.oscar.practice.shiro.model.user.RoleInfo;

/**
 * 角色管理
 *
 * @author tongyufu
 *
 */
@Repository
public interface RoleDao {

    Set<String> queryByUserId(Integer userId);

    List<RoleInfo> search(Map<String, Object> params);

    int searchTotal(Map<String, Object> params);

    List<RoleInfo> queryAllRole();

    RoleInfo queryById(Integer id);

    int saveRole(RoleInfo roleInfo);

    int saveRolePermission(@Param("roleId") Integer roleId,
                           @Param("permissionId") Integer permissionId);

    int updateRole(RoleInfo roleInfo);

    int deleteRole(Integer roleId);

    int deleteRolePermission(Integer roleId);
}
